package com.sdx.console.orgmain.service;

import com.ibeetl.admin.core.entity.CoreOrg;
import com.ibeetl.admin.core.service.BaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.sdx.console.orgmain.dao.OrgLectureDao;
import com.sdx.console.orgmain.entity.OrgLecture;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * OrgLecture Service
 */

@Service
@Transactional
public class OrgLectureService extends BaseService<OrgLecture>{

    @Resource
	private OrgLectureDao orgLectureDao;

    public PageQuery<OrgLecture>queryByCondition(PageQuery query){
        PageQuery ret =  orgLectureDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelOrgLecture(List<String> ids){
        try {
            orgLectureDao.batchDelOrgLectureByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除OrgLecture失败", e);
        }
    }

	public List<OrgLecture> all() {
		return orgLectureDao.all();
		}

    public List<OrgLecture> queryByProvinceId(String provinceId)
    {
        return orgLectureDao.queryByProvinceId(provinceId);
    }


    public CoreOrg selectCoreOrgById(Integer orgId){
        return orgLectureDao. selectCoreOrgById( orgId);
    }
}